<?php use_helper("I18N") ?>

<h1 class="title">Changer mes informations du profil</h1>

<?php foreach($form as $field => $f): ?>
    <?php $attributes[$field] = array() ?>
<?php endforeach ?>

<?php if ($form->hasErrors()): ?>
    <?php foreach($form as $field => $f): ?>
      <?php if($f->hasError()): ?>
        <?php $attributes[$field] = array('class' => 'error') ?>
      <?php endif ?>
    <?php endforeach ?>
    <div class="box_relief red">Certains champs sont incomplets et/ou invalides.</div>
<?php endif; ?>

<form method="post" action="<?php echo url_for("sfApply/settings") ?>" name="sf_apply_settings_form" id="sf_apply_settings_form">
    <h2>Vos informations personnelles</h2>
    <table>
        <tr>
            <td></td>
            <td><?php echo $form['lastname']->renderError() ?></td>
        </tr>
        <tr>
            <td><?php echo $form['lastname']->renderLabel('Nom* :', $attributes['lastname']) ?></td>
            <td><?php echo $form['lastname']->render() ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['firstname']->renderError() ?></td>
        </tr>
        <tr>
            <td><?php echo $form['firstname']->renderLabel('Prénom* :', $attributes['firstname']) ?></td>
            <td><?php echo $form['firstname']->render() ?></td>
        </tr>
    </table>
    <h2>Vos informations tennis de table</h2>
    <table>
        <tr>
            <td></td>
            <td><?php echo $form['licensee']['licensee_number']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['licensee']['licensee_number']->renderLabel('N° licence :') ?></td>
             <td><?php echo $form['licensee']['licensee_number']->render() ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['licensee']['category']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['licensee']['category']->renderLabel('Catégorie :') ?></td>
             <td><?php echo $form['licensee']['category']->render() ?></td>
        </tr>
    </table>
    <h2>Votre club</h2>
    <table id="club_list">
        <tr>
            <td></td>
            <td><?php echo $form['licensee']['club_id']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['licensee']['club_id']->renderLabel('N° ou nom du club :') ?></td>
             <td><?php echo $form['licensee']['club_id']->render() ?></td>
        </tr>
        <tr>
             <td></td>
             <td><em><a href="#profil-modification" id="link_register_club">Votre club n'est pas présent ?</a></em></td>
        </tr>
    </table>
    <table id="register_club" style="display: none;">
        <tr>
             <td colspan="2"><em><a href="#profil-modification" id="link_club_list">Annuler l'enregistrement de votre club</a></em></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['club']['name']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['club']['name']->renderLabel('Nom du club* :') ?></td>
             <td><?php echo $form['club']['name']->render() ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['club']['club_number']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['club']['club_number']->renderLabel('N° du club* :') ?></td>
             <td><?php echo $form['club']['club_number']->render() ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['club']['city_id']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['club']['city_id']->renderLabel('Ville :') ?></td>
             <td><?php echo $form['club']['city_id']->render() ?></td>
        </tr>
        <tr>
            <td></td>
            <td><?php echo $form['club']['website']->renderError() ?></td>
        </tr>
        <tr>
             <td><?php echo $form['club']['website']->renderLabel('Site web :') ?></td>
             <td><?php echo $form['club']['website']->render() ?></td>
        </tr>
    </table>
    <ul>
        <li class="submit_row">
            <?php echo $form->renderHiddenFields(); ?>
            <input type="submit" value="<?php echo __("Save", array(), 'sfForkedApply') ?>" class="box_relief dark_blue" />
        </li>
    </ul>
</form>
<p class="mandatoryInformations">(*) Informations obligatoires</p>